﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DALScolarite;
namespace Scolarite 
{
    public partial class ListeEtudiants : Form
    {
        public ListeEtudiants()
        {
            InitializeComponent();
        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void label3_Click(object sender, EventArgs e)
        {

        }

        private void ListeEtudiants_Load(object sender, EventArgs e)
        {
            scolarite_etudiantsBindingSource.DataSource = GlobalParams.MonDbcontext.scolarite_etudiants.ToList();
        }

        private void scolarite_etudiantsDataGridView_DoubleClick(object sender, EventArgs e)
        {

        }

        private void scolarite_etudiantsDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridViewRow row = this.scolarite_etudiantsDataGridView.Rows[e.RowIndex];


            FicheEtudiant fiche = new FicheEtudiant();
            fiche.MdiParent = this.MdiParent;
            fiche.loadingmod = modeload.INFO;
            fiche.idetudiants = (long) row.Cells[0].Value;
            fiche.Show();
        }

        private void scolarite_etudiantsDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void BTRechercher_Click(object sender, EventArgs e)
        {
            scolarite_etudiants ent = new scolarite_etudiants();




            scolarite_etudiantsBindingSource.DataSource = ent.rechercher(new scolarite_etudiants
            { 
                    cin = CIN_RECH_textBox.Text,
                    NomFR = NOMFR_RECH_textBox.Text,
                    PrenomFR = PRENOMFR_RECH_textBox.Text
            });
        }
    }
}
